#include<stdio.h>
int main(){
	int n = 0;
	int count = 1;
	scanf("%d",&n);
	while(count<=(n*n)){
		printf("%02d",count);
		if(count%n == 0){
			printf("\n"); 
		} 
		count++;
	}
	printf("\n");
	
	int i = 0;
	int j = 0;
	count = 1;
	for(i=1;i<=n;i++){
		for(j=1;j<=n;j++){
			 
			if(j > n-i){
				printf("%02d",count);
				count++; 
			} 
			else{
				printf("  ");
			}
		} 
		printf("\n");
		
	} 
}
